/* 报表统计页面专用样式 */

/* 报表筛选和控制区域 */
.report-filters {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.report-filters:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.filter-group select,
.filter-group input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
}

.filter-group select:focus,
.filter-group input[type="date"]:focus {
    outline: none;
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
}

.filter-group.custom-date {
    display: none;
}

.filter-controls button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.generate-report-btn {
    background-color: #409eff;
    color: white;
}

.generate-report-btn:hover {
    background-color: #66b1ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
}

.export-report-btn,
.email-report-btn {
    background-color: #f5f7fa;
    color: #606266;
    border: 1px solid #ebeef5;
}

.export-report-btn:hover,
.email-report-btn:hover {
    background-color: #ecf5ff;
    color: #409eff;
    border-color: #d9ecff;
}

/* 报表概览卡片 */
.report-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.overview-card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid #ebeef5;
}

.overview-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f2f5;
}

.overview-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #303133;
}

.report-period {
    font-size: 12px;
    color: #909399;
    background-color: #f5f7fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.overview-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.overview-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #409eff;
}

.stat-label {
    font-size: 12px;
    color: #909399;
}

.overview-chart {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-chart {
    width: 80px;
    height: 60px;
    background: linear-gradient(135deg, #ecf5ff 0%, #d9ecff 100%);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.mini-chart::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 70%;
    width: 100%;
    background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%);
    border-radius: 4px 4px 0 0;
}

/* 详细报表区域 */
.detailed-reports {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.report-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
    border: 1px solid #ebeef5;
}

.report-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.report-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f0f2f5;
}

.report-card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #303133;
}

.report-actions {
    display: flex;
    gap: 8px;
}

.report-actions button {
    padding: 6px 12px;
    border: 1px solid #ebeef5;
    background-color: #ffffff;
    color: #606266;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.report-actions button:hover {
    color: #409eff;
    border-color: #d9ecff;
    background-color: #ecf5ff;
}

.report-card-body {
    padding: 20px;
}

.report-summary {
    margin-bottom: 16px;
    color: #606266;
    font-size: 14px;
    line-height: 1.6;
}

.report-content {
    overflow-x: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.report-table th,
.report-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ebeef5;
}

.report-table th {
    font-weight: 600;
    color: #303133;
    background-color: #fafafa;
    position: sticky;
    top: 0;
    z-index: 1;
}

.report-table td {
    color: #606266;
}

.report-table tr:hover td {
    background-color: #f5f7fa;
}

.report-table tr:last-child td {
    border-bottom: none;
}

/* 报表下载历史 */
.report-history {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #ebeef5;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.history-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #303133;
}

.clear-history {
    padding: 6px 12px;
    border: 1px solid #ebeef5;
    background-color: #ffffff;
    color: #f56c6c;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-history:hover {
    border-color: #fbc4c4;
    background-color: #fef0f0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #ebeef5;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.history-item:hover {
    background-color: #f5f7fa;
    border-color: #d9ecff;
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-name {
    font-size: 14px;
    font-weight: 500;
    color: #303133;
}

.history-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #909399;
}

.history-actions {
    display: flex;
    gap: 8px;
}

.download-btn,
.delete-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ebeef5;
    background-color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

.download-btn {
    color: #409eff;
}

.download-btn:hover {
    background-color: #ecf5ff;
    border-color: #d9ecff;
}

.delete-btn {
    color: #f56c6c;
}

.delete-btn:hover {
    background-color: #fef0f0;
    border-color: #fbc4c4;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .report-overview {
        grid-template-columns: 1fr;
    }
    
    .overview-content {
        grid-template-columns: 1fr;
    }
    
    .mini-chart {
        width: 100%;
        height: 40px;
    }
    
    .report-card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .report-actions {
        justify-content: flex-end;
    }
    
    .history-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .history-actions {
        justify-content: flex-end;
    }
}

/* 加载动画和过渡效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.overview-card,
.report-card,
.report-history {
    animation: fadeInUp 0.6s ease-out;
}

.overview-card:nth-child(2) {
    animation-delay: 0.1s;
}

.overview-card:nth-child(3) {
    animation-delay: 0.2s;
}

.report-card:nth-child(1) {
    animation-delay: 0.3s;
}

.report-card:nth-child(2) {
    animation-delay: 0.4s;
}

.report-card:nth-child(3) {
    animation-delay: 0.5s;
}

.report-history {
    animation-delay: 0.6s;
}

/* 打印样式 */
@media print {
    .sidebar,
    .top-navbar,
    .report-filters,
    .report-actions,
    .history-actions,
    .clear-history {
        display: none !important;
    }
    
    .content-container {
        margin-left: 0 !important;
    }
    
    .report-card,
    .overview-card,
    .report-history {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .report-table {
        page-break-inside: avoid;
    }
}

/* 深色模式支持 */
body.dark-mode .report-filters,
body.dark-mode .overview-card,
body.dark-mode .report-card,
body.dark-mode .report-history,
body.dark-mode .filter-group select,
body.dark-mode .filter-group input[type="date"] {
    background-color: #1f1f1f;
    border-color: #333;
}

body.dark-mode .filter-group label,
body.dark-mode .overview-header h3,
body.dark-mode .report-card-header h3,
body.dark-mode .history-header h3,
body.dark-mode .stat-label,
body.dark-mode .history-meta,
body.dark-mode .report-summary {
    color: #ccc;
}

body.dark-mode .report-period {
    background-color: #333;
    color: #999;
}

body.dark-mode .report-table th,
body.dark-mode .report-table td {
    border-color: #333;
    color: #ccc;
}

body.dark-mode .report-table th {
    background-color: #2a2a2a;
}

body.dark-mode .history-item:hover {
    background-color: #2a2a2a;
}

body.dark-mode .report-table tr:hover td {
    background-color: #2a2a2a;
}